package com.ruoyi.purpose.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purpose.mapper.HousePurposeTMapper;
import com.ruoyi.purpose.domain.HousePurposeT;
import com.ruoyi.purpose.service.IHousePurposeTService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 房屋用途Service业务层处理
 * 
 * @author lijie
 * @date 2023-04-20
 */
@Service
public class HousePurposeTServiceImpl implements IHousePurposeTService 
{
    @Autowired
    private HousePurposeTMapper housePurposeTMapper;

    /**
     * 查询房屋用途
     * 
     * @param purposeId 房屋用途主键
     * @return 房屋用途
     */
    @Override
    public HousePurposeT selectHousePurposeTByPurposeId(Long purposeId)
    {
        return housePurposeTMapper.selectHousePurposeTByPurposeId(purposeId);
    }
    @Override
    public HousePurposeT selectHousePurposeTByPurposeName(String purposeName)
    {
        return housePurposeTMapper.selectHousePurposeTByPurposeName(purposeName);
    }

    /**
     * 查询房屋用途列表
     * 
     * @param housePurposeT 房屋用途
     * @return 房屋用途
     */
    @Override
    public List<HousePurposeT> selectHousePurposeTList(HousePurposeT housePurposeT)
    {
        return housePurposeTMapper.selectHousePurposeTList(housePurposeT);
    }

    /**
     * 新增房屋用途
     * 
     * @param housePurposeT 房屋用途
     * @return 结果
     */
    @Transactional
    @Override
    public int insertHousePurposeT(HousePurposeT housePurposeT)
    {
        return housePurposeTMapper.insertHousePurposeT(housePurposeT);
    }

    /**
     * 修改房屋用途
     * 
     * @param housePurposeT 房屋用途
     * @return 结果
     */
    @Transactional
    @Override
    public int updateHousePurposeT(HousePurposeT housePurposeT)
    {
        return housePurposeTMapper.updateHousePurposeT(housePurposeT);
    }

    /**
     * 批量删除房屋用途
     * 
     * @param purposeIds 需要删除的房屋用途主键
     * @return 结果
     */
    @Transactional
    @Override
    public int deleteHousePurposeTByPurposeIds(Long[] purposeIds)
    {
        return housePurposeTMapper.deleteHousePurposeTByPurposeIds(purposeIds);
    }

    /**
     * 删除房屋用途信息
     * 
     * @param purposeId 房屋用途主键
     * @return 结果
     */
    @Transactional
    @Override
    public int deleteHousePurposeTByPurposeId(Long purposeId)
    {
        return housePurposeTMapper.deleteHousePurposeTByPurposeId(purposeId);
    }
}
